<script>
import ValueWithInput from '@/views/personnel-files/components/ValueWithInput/WithInput.vue'
import ValueWithInputNumber from '@/views/personnel-files/components/ValueWithInput/WithNumberInput.vue'
export default {
  components: {
    ValueWithInput,
    ValueWithInputNumber
  },
  props: {
    fallback: {
      type: String,
      default: '-'
    },
    isEditing: false
  },
  data() {
    return {

    }
  },
  computed: {
    attrs() {
      const attrs = { ...this.$attrs }
      return attrs
    },
    listeners() {
      const listeners = { ...this.$listeners }
      return listeners
    },
    valueType() {
      if (typeof this.$attrs.value === 'string') return 'string'
      else if (typeof this.$attrs.value === 'number') return 'number'
      return 'string'
    }
  }
}
</script>
<template>
  <div>
    <ValueWithInput
      v-if="valueType === 'string'"
      v-bind="attrs"
      :is-editing="isEditing"
      v-on="listeners"
    />

    <ValueWithInputNumber
      v-if="valueType === 'number'"
      v-bind="attrs"
      :is-editing="isEditing"
      v-on="listeners"
    />
  </div>
</template>

<style lang="scss">
</style>
